﻿<!DOCTYPE html>
<html>
	<head>
		<!-- 设置浏览器不缓存 -->
		<META HTTP-EQUIV="pragma" CONTENT="no-cache">
		<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
		<META HTTP-EQUIV="expires" CONTENT="0">
		<!-- Content-Type -->
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
		<!-- Favicon -->
		<link rel="shortcut icon" href="./images/logo.png">
		<title>企业服务共享中心</title>
		<!--stylesheets-->
		<link rel="stylesheet" href="./plugins/element/index.css">
		<script src="./plugins/vue/vue.js"></script>
		<script src="./plugins/element/index.js"></script>
		<script src="./plugins/vue/clipboard.js"></script>
		<script src="./plugins/axios/axios.min.js"></script>
		<script src="./js/common/public.js?v=0.8.0.3"></script>
		<!-- 自定义样式表 -->
		<link rel="stylesheet" href="./css/base.css?v=0.8.0.3">
	</head>
	<style type="text/css">
		.el-range-editor.el-input__inner {
			width: 200px;
		}

		.el-range-editor .el-range-input {
			width: 80px;
		}
	</style>
	<body>
		<div id="app">
			<template>
				<el-container class="maincontainer">
					<el-container class="submaincontainer">
						<el-card class="box-card" style="position:relative;width:330px" shadow="never" v-show="leftbar_show">
							<div style="position:absolute;left:0;top:0;right:0;bottom:0;overflow-y:auto;overflow-x:hidden;padding-left: 20px;padding-top: 20px;padding-right: 20px;">
								<el-form :model="queryForm" ref="queryForm">
									<el-form-item label="关键字" prop="keyword" maxlength="20" autocomplete="off">
										<el-input v-model="queryForm.keyword"></el-input>
									</el-form-item>
									<el-form-item label="办理事项" prop="matter">
										<el-select v-model="queryForm.matter" placeholder="请选择" filterable clearable allow-create default-first-option>
											<el-option v-for="item in handleitems" :key="item.id" :label="item.value" :value="item.value">
											</el-option>
										</el-select>

									</el-form-item>
									<el-form-item label="状态" prop="status">
										<el-select v-model="queryForm.status" placeholder="请选择" filterable clearable>
											<el-option v-for="item in status" :key="item.value" :label="item.label" :value="item.value">
											</el-option>
										</el-select>
									</el-form-item>
									<el-form-item label="协助部门主管" prop="charger">
										<el-select v-model="queryForm.charger" multiple placeholder="请选择" filterable clearable>
											<el-option v-for="item in allusers" :key="item.id" :label="item.name" :value="item.id">
											</el-option>
										</el-select>
									</el-form-item>
									<el-form-item label="截止日期" prop="endTime">
										<el-date-picker v-model="queryForm.endTime" type="datetimerange" value-format="yyyy-MM-dd" :picker-options="pickerOptions"
										 range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" align="left">
										</el-date-picker>
									</el-form-item>
									<el-form-item label="添加时间" prop="createTime">
										<el-date-picker v-model="queryForm.createTime" type="datetimerange" value-format="yyyy-MM-dd" :picker-options="pickerOptions"
										 range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" align="left">
										</el-date-picker>
									</el-form-item>

									<el-form-item label="更新时间" prop="updateTime">
										<el-date-picker v-model="queryForm.updateTime" type="datetimerange" value-format="yyyy-MM-dd" :picker-options="pickerOptions"
										 range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" align="left">
										</el-date-picker>
									</el-form-item>

									<el-form-item>
										<el-button size="small" type="primary" @click.native.prevent="start" style="position:fixed;left:20px;bottom:5px;">查询</el-button>
									</el-form-item>
								</el-form>
							</div>
						</el-card>




						<el-card class="box-card" style="width:100%" shadow="never">
							<div slot="header" class="clearfix">
								<i v-on:click="showLeftBar()" v-bind:class="[leftbar_show ? 'el-icon-s-fold' : 'el-icon-s-unfold']" style="color:#409EFF;cursor:pointer;"></i>
								<span>内部事务列表</span>
			<el-button-group style="float: right;margin-top:0px;">
					<el-tooltip v-for="item in toolbar" class="item" effect="dark" v-bind:content="item.content" placement="top-start">
						  <el-button size="small" v-bind:icon="item.icon" v-bind:type="item.type" @click="toolAction(item.content)">{{item.content}}</el-button>
					</el-tooltip>
			</el-button-group>
							</div>
							<div>
								<el-table ref="multipleTable" @select='selectionChange' :data="pagedata" tooltip-effect="dark" :height="tableHeight"
								 border highlight-current-row style="width: 100%;" @selection-change="handleSelectionChange">
									<el-table-column type="selection" min-width="55">
									</el-table-column>
									<el-table-column type="expand">
										<template slot-scope="props">
											<el-form label-position="left" inline class="demo-table-expand">
												<el-table :data="props.row.recs" stripe border>
													<el-table-column label="事项" prop="matter"></el-table-column>
													<el-table-column label="状态" prop="status"></el-table-column>
													<el-table-column label="创建日期" prop="createTime"></el-table-column>
													<el-table-column label="截止日期" prop="endTime"></el-table-column>
													<el-table-column label="负责人" prop="charger"></el-table-column>
													<el-table-column label="备注" prop="remake"></el-table-column>

													<el-table-column label="更新日期" prop="updateTime"></el-table-column>
													<el-table-column label="操作" min-width="50">
														<template slot-scope="scope">
															<el-link type="primary" @click="edititem(scope.$index, scope.row)" v-if="localStorage.getItem('USERID')==scope.row.chargerId||localStorage.getItem('ISLEADER')=='是'">编辑</el-link>
															<el-link type="primary" @click="remove(scope.$index, scope.row)" v-if="localStorage.getItem('ISLEADER')=='是'">删除</el-link>
														</template>
													</el-table-column>
												</el-table>
											</el-form>
										</template>
									</el-table-column>


								<el-table-column v-for="column in tablecolums" v-bind:prop="column.prop" v-bind:label="column.label"
									 v-bind:min-width="column.width" show-overflow-tooltip sortable>
									</el-table-column>
									<el-table-column label="操作" min-width="80">
										<template slot-scope="scope">
											<el-link type="primary"  @click="audit(scope.$index, scope.row)" v-show="showAudit(scope.$index, scope.row)">审核</el-link>
											<el-link type="primary" @click="additem(scope.$index, scope.row)" v-if="localStorage.getItem('ISLEADER')=='是'&scope.row.auditStatus=='已审核'">分配</el-link>
											<el-link type="primary" @click="edit(scope.$index, scope.row)" v-if="localStorage.getItem('ISLEADER')=='是'&scope.row.auditStatus=='已驳回'">修改</el-link>
										</template>
									</el-table-column>

								</el-table>


								<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentPageChange" :current-page="queryForm.pageNo"
								 :page-sizes="queryForm.pagesizes" :page-size="queryForm.pagesize" background layout="total,sizes, prev, pager, next"
								 :total="pagetotal">
								</el-pagination>
							</div>
		</div>
		</el-card>
		</el-container>
		</el-container>
		<el-dialog :close-on-click-modal="false" title="新增/编辑/审核业务" :visible.sync="dialogEditFormVisible" width="600px">
			<el-form :model="transForm" :rules="transFormrules" ref="transForm" label-width="150px" :disabled='ifdisabled'>
				<el-row :gutter="20">
					<el-col :span="16">
						<el-form-item label="截止日期" prop="enddate" class="dialogstyle">
							<el-date-picker v-model="transForm.enddate" type="date" placeholder="选择日期" value-format="yyyy-MM-dd">
							</el-date-picker>
						</el-form-item>
					</el-col>
				</el-row>
				</el-row>
				<el-row :gutter="20">
					<el-col :span="24">
						<el-form-item label="申请人" prop="applicantId" class="dialogstyle">
							<el-select v-model="transForm.applicantId" placeholder="请选择" filterable clearable :disabled="action!='add'">
								<el-option v-for="item in allusers" :key="item.id" :label="item.name" :value="item.id">
								</el-option>
							</el-select>
						</el-form-item>
					</el-col>
				</el-row>
				<el-row :gutter="20">
					<el-col :span="24">
						<el-form-item label="发起部门审批人" prop="auditleaderId" class="dialogstyle">
							<el-select v-model="transForm.auditleaderId" placeholder="请选择" filterable clearable>
								<el-option-group
								  v-for="group in users"
								  :key="group.deptname"
								  :label="group.deptname">
								  <el-option
									v-for="item in group.users"
									:key="item.id"
									:label="item.name"
									:value="item.id">
								  </el-option>
								</el-option-group>
<!-- 								<el-option v-for="item in teamsLaeder" :key="item.id" :label="item.username" :value="item.id">
								</el-option> -->
							</el-select>
						</el-form-item>
					</el-col>
				</el-row>
				<el-row :gutter="20">
					<el-col :span="24">
						<el-form-item label="协助部门主管" prop="leaderId" class="dialogstyle">
							<el-select v-model="transForm.leaderId" placeholder="请选择" filterable clearable>
								<el-option-group
								  v-for="group in users"
								  :key="group.deptname"
								  :label="group.deptname">
								  <el-option
									v-for="item in group.users"
									:key="item.id"
									:label="item.name"
									:value="item.id">
								  </el-option>
								</el-option-group>
							</el-select>
						</el-form-item>
					</el-col>
				</el-row>
				<el-row :gutter="20">
					<el-col :span="24">
						<el-form-item label="标题" prop="name" class="dialogstyle">
							<el-input v-model="transForm.name" style="width: 200px;"></el-input>
						</el-form-item>
					</el-col>
				</el-row>
				<el-row :gutter="20">
					<el-col :span="24">
						<el-form-item label="备注" prop="remake" class="dialogstyle">
							<el-input v-model="transForm.remake" maxlength="250" type="textarea" ></el-input>
						</el-form-item>
					</el-col>
				</el-row>
				<el-row :gutter="20">
					<el-col :span="24">
				<el-form-item label="上传文件" prop="evidence">
					<el-upload
					  class="avatar-uploader"
					  ref="upload"
					  multiple
					  :limit="20"
					  :file-list="fileList"
					  :action="uploadtransformurl + transForm.applicantId"
					  :headers="headers"
					  list-type="text"
					  :on-preview="handlemaindownloadPreview"
					  :on-remove="handlemainRemove"
					  :on-success="handlemainAvatarSuccess"
					  >
					  <i class="el-icon-plus">点击上传截图及相关材料</i>
					</el-upload>		
							</el-form-item>
							</el-col>
							</el-row>
			</el-form> 
			<div slot="footer" class="dialog-footer">
				<el-button @click="dialogEditFormVisible = false" v-show="action!='audit'">取 消</el-button>
				<el-button type="primary" :disabled="submitEditDisable" @click="editcofirm" v-show="action!='audit'">确 定</el-button>
				<el-button type="warning" @click="nopass" v-show="action=='audit'">驳 回</el-button>
				<el-button type="primary" @click="cofirm" v-show="action=='audit'">通 过</el-button>
			</div>
		</el-dialog>







		<el-dialog :close-on-click-modal="false" title="添加/编辑 办理事项" :visible.sync="dialogItemFormVisible" width="600px">
			<el-form :model="innerworkorderDetailForm" :rules="innerworkorderDetailFormrules" ref="innerworkorderDetailForm" label-width="80px">
				<el-row :gutter="20">
					<el-col :span="24">
						<el-form-item label="事项" prop="matter">
							<el-select v-model="innerworkorderDetailForm.matter" placeholder="请选择" filterable clearable allow-create>
								<el-option v-for="item in handleitems" :key="item.id" :label="item.value" :value="item.value">
								</el-option>
							</el-select>
						</el-form-item>
					</el-col>
				</el-row>
				<el-row :gutter="20">
					<el-col :span="24">
						<el-form-item label="状态" prop="status">
							<el-select v-model="innerworkorderDetailForm.status" placeholder="请选择" filterable clearable>
								<el-option v-for="item in status" :key="item.value" :label="item.label" :value="item.value">
								</el-option>
							</el-select>
						</el-form-item>
					</el-col>
				</el-row>
				<el-row :gutter="20">
					<el-col :span="16">
						<el-form-item label="截止日期" prop="endTime">
							<el-date-picker v-model="innerworkorderDetailForm.endTime" type="date" placeholder="选择日期" value-format="yyyy-MM-dd">
							</el-date-picker>
						</el-form-item>
					</el-col>
				</el-row>
				</el-row>
				<el-row :gutter="20">
					<el-col :span="24">
						<el-form-item label="负责人" prop="charger">
							<el-select v-model="innerworkorderDetailForm.chargerId" placeholder="请选择" filterable clearable>
								<el-option v-for="item in allusers" :key="item.id" :label="item.name" :value="item.id">
								</el-option>
							</el-select>
						</el-form-item>
					</el-col>
				</el-row>
				<el-row :gutter="20">
					<el-col :span="24">
						<el-form-item label="备注" prop="remake">
							<el-input v-model="innerworkorderDetailForm.remake" maxlength="250" type="textarea"></el-input>
						</el-form-item>
					</el-col>
				</el-row>
				<el-row :gutter="20" v-if="action!='additem'">
					<el-col :span="24">
						<el-form-item label="证据上传" prop="evidence">
			<el-upload class="avatar-uploader" ref="upload" multiple :limit="20" :file-list="fileList" :action="uploadurl + innerworkorderDetailForm.innerworkorderId+'/'+innerworkorderDetailForm.id"
			 :headers="headers" list-type="picture" :on-preview="handledownloadPreview" :on-remove="handleRemove"  :auto-upload="true" accept=".jpg,.png"
			 :on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload">
				<i class="el-icon-plus">点击上传图片不超过20张图片</i>
			</el-upload>


						</el-form-item>
					</el-col>
				</el-row>



			</el-form>
			<div slot="footer" class="dialog-footer">
				<el-button @click="dialogItemFormVisible = false">取 消</el-button>
				<el-button type="primary" :disabled="submitDisable" @click="itemcofirm">确 定</el-button>
			</div>
		</el-dialog>
		<el-dialog :visible.sync="imgdialogVisible">
		<img width="100%" :src="imgdialogImageUrl" alt="">
		</el-dialog>

		</template>
		</div>
	</body>

	<script src="./js/innerworkorder.js"></script>

	</script>
</html>
